//
//  MovieListCollectionViewCell.m
//  FNer
//
//  Created by dllo on 15/11/7.
//  Copyright © 2015年 刘志强. All rights reserved.
//

#import "MovieListCollectionViewCell.h"

@implementation MovieListCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatCell];
    }
    return self;
}
-(void)creatCell
{
    self.contentView.backgroundColor = [UIColor clearColor];
    
    self.coverForFeed = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, 150)];

    [self.contentView addSubview:self.coverForFeed];
    UIView *boliView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, 150 * XHIGHT)];
    boliView.backgroundColor = [UIColor colorWithRed:30 / 255.0 green:30 /255.0 blue:30 / 255.0 alpha:0.1];
    [self.coverForFeed addSubview:boliView];
    
    self.title = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, WIDTH, 40 * XHIGHT)];
    self.title.center = CGPointMake(WIDTH / 2, 75 * XHIGHT);
    //    self.nameLabel.backgroundColor = [UIColor blackColor];
    self.title.textAlignment = NSTextAlignmentCenter;
    self.title.textColor = [UIColor whiteColor];
    self.title.font = [UIFont fontWithName:@"Helvetica-BoldOblique" size:18 * XWIDTH];
    
    self.title.alpha = 1.0;
    
    
    [boliView addSubview:self.title];
   
}
-(void)setModel:(MovieCoreData *)model
{
    _model = model;
    
    self.title.text = _model.title;
    
    
    NSURL *url = [NSURL URLWithString:_model.coverForFeed];
    
    [self.coverForFeed sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@""]];
    
    
    
    
}
@end
